package cn.wolfcode.crm.web.controller;

import cn.wolfcode.crm.domain.InsureInfo;
import cn.wolfcode.crm.service.IInsureInfoService;
import cn.wolfcode.crm.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("insureInfo")
public class InsureInfoController {
    @Autowired
    private IInsureInfoService insureInfoService;

    @RequestMapping("view")
    public String view(){
        return "insurance/insureInfo";
    }

    @RequestMapping("saveOrUpdate")
    @ResponseBody
    public Object saveOrUpdate(InsureInfo info){
        try {
            insureInfoService.saveOrUpdate(info);
        } catch (Exception e) {
            e.printStackTrace();
            return new JsonResult().mark(e.getMessage());
        }
        return new JsonResult();
    }
}
